
const getWeiBoList = async (id) => {
  if(!window.utools)return[];
  let res = await window.utools.ubrowser
  .goto("https://tophub.today/n/KqndgxeLl9")
  // .devTools('right')
  .wait('tbody', 60000)
  .wait(200)
  .evaluate(() => {
    let hotList = [...document.querySelectorAll('tr')].slice(0, 50);
    let arr = hotList.map((item, index) => {
      let url = item.querySelector('.al').querySelector('a').href;
      let articleNumber = index + 1;
      let articleDetail = item.querySelector('.al').querySelector('a').innerText;
      let hotNumber = item.querySelector('.al ~ td').innerText;

      return {
        url,
        index: articleNumber,
        detail: articleDetail,
        hot: hotNumber,
      };
    });
    return arr;
  })
  .run({ show: false });
  // .run({ width: 1300, height: 1000 });
  window.utools.clearUBrowserCache();
  return {
    id,
    list: res[0]
  }
};


export { getWeiBoList };